import type { PageParams, PageResult } from '@/types/global'
import type { GuessItem, HomeBannerItem, HomeCategoryItem, HomeHotMutliItem } from '@/types/home'
import { request } from '@/utils/reuqest'

/**
 * 首页-广告区域-小程序
 * @param distributionSite 广告区域展示位置（投放位置 投放位置，1为首页，2为分类商品页） 默认是1
 */
export const getHomeBannerAPI = (distributionSite: number) => {
  return request<HomeBannerItem[]>('/home/banner', 'GET', {
    distributionSite,
  })
}
/**
 * 首页-前台分类-小程序
 */
export const getHomeCategoryAPI = () => {
  return request<HomeCategoryItem[]>('/home/category/mutli', 'GET')
}

/**
 * 首页-热门推荐-小程序
 */
export const getHomeHotMutliAPI = () => {
  return request<HomeHotMutliItem[]>('/home/hot/mutli', 'GET')
}

/**
 * 猜你喜欢-小程序
 */
// /home/dgoos / guessLike
export const getHomeDgoosGuessLikeAPI = (data?: PageParams) => {
  return request<PageResult<GuessItem>>('/home/goods/guessLike', 'GET', data)
}
